<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<ul>
				<li v-for="item in arr">
					{{item}}
				</li>
			</ul>
			<ol>
				<li v-for="todo in todos">
					{{todo.text}}
				</li>
			</ol>
			<button @click="add">添加数据</button>
			<button @click="remove">删除数据</button>
		</div>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script>
			var app = new Vue({
				el:"#app",
				data:{
					arr:[1,2,3,4,5],
					todos : [
						{text:'学习js'},
						{text:'学习vue'},
						{text:'学习前端'}
					]
				},
				methods:{
					add:function(){
						this.todos.push({text:'学习DOM'});
					},
					remove:function(){
						this.todos.shift();
					}
				}
			})
		</script>
	</body>
</html>
